//
//  SNShopThemeActsListModel.m
//  app
//
//  Created by 王少宁 on 15/8/20.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "SNShopThemeActsListModel.h"

@implementation SNShopThemeActsListModel

- (instancetype)initWithArray:(NSArray *)array
{
    if ([super initWithArray:array]) {
        
        if (array && array.count) {
            NSMutableArray * mutableArray = [NSMutableArray array];
            for (NSDictionary * dic in array) {
                SNShopThemeActsListSubModel * model = [SNShopThemeActsListSubModel modelWithDict:dic];
                [mutableArray addObject:model];
            }
            _themeActsListArray = mutableArray;
            
            self.rowNumber = 1;
            self.cellHeight = SCREEN_WIDTH * 425/720;
            self.headerView = YES;
            self.headerTitle = @"商品劲爆";
        }
    }
    return self;
}

@end





@implementation SNShopCountdownModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if ([super init]) {
        
    }
    return self;
}

+ (instancetype)modelWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}

@end





@implementation SNShopThemeActsListSubModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if ([super init]) {
        _act_id = [dict[@"act_id"] stringValue];
        _name = dict[@"name"];
        _pic = dict[@"pic"];
        _width = [dict[@"width"] stringValue];
        _height = [dict[@"height"] stringValue];
        _intro = dict[@"intro"];
        _product_id = [dict[@"product_id"] stringValue];
        
        NSDictionary * countdownDict = dict[@"countdown"];
        if (countdownDict && countdownDict.allKeys.count) {
            _countdownModel = [SNShopCountdownModel modelWithDict:countdownDict];
        }
        
    }
    return self;
}

+ (instancetype)modelWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}

@end
